package com.rockwell.sniffyhunter;

import com.rockwell.sniffyhunter.R;
import com.rockwell.sniffyhunter.views.MazeCameraView;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;

public class TeachActivity extends Activity {
	private MazeCameraView	m_mazeCameraView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_teach);
		
		m_mazeCameraView = (MazeCameraView) this.findViewById(R.id.maze_camera_view);
		m_mazeCameraView.setTeachMode(true);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.robot, menu);
		return true;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle item selection
		switch(item.getItemId()) {
			case R.id.action_settings:
				//TODO: The robot menu is inflated in this activity. Why?
				return true;
			default:
				return super.onOptionsItemSelected(item);
		}
	}

	@Override
    public void onPause()
    {
        super.onPause();
        m_mazeCameraView.onDeactivated();
    }

	@Override
	public void onStop() {

		super.onStop();
		m_mazeCameraView.onDeactivated();
	}
	
	@Override
	public void onResume() {
		super.onResume();
		m_mazeCameraView.onActivated();
	}
}
